const columns = (onRemove, namespace) => {
  return [
      {
          type: 'index',
          width: 60,
          align: 'center'
      },
      {
        title: '用户',
        width:180,
        key: 'account'
      },
      {
          title: '状态',
          key: 'online',
          width: 180,
          render: (h, { row, column, index }) => {
            if(row.online === '1') {
              return h('Tag', {
                props: {
                  type: 'dot',
                  color: 'green'
                }
              }, '在线')
            } else {
              return h('Tag', {
                props: {
                  type: 'dot',
                }
              }, '离线')
            }
          }
      },
      {
          title: '会话ID',
          key: 'sessionId',
      },
      {
        title: '登录IP',
        width:180,
        key: 'ip'
      },
      {
          title: '登录时间',
          key: 'startTime',
          width: 180
      }, {
          title: '操作',
          key: 'operation',
          width: 140,
          render: (h, { row, column, index }) => {
              return h('div', [
                  h('Button', {
                      on: {
                          click: () => onRemove(row.sessionId)
                      },
                      props: {
                          type: 'text',
                          size: 'small',
                          disabled:row.userId == localStorage.userId || row.online == '0'
                      },
                  }, '强制下线')
              ]);
          }
      }
  ]
}
export default columns;
